class Animal {
    constructor(age) {
        this.age = age
    }
    //实例方法
    say() {
        console.log('wow~~~')
    }
    //静态方法
    static walk() {
        console.log('我能行走的')
    }
    sleep(){
        console.log('我会准时睡觉的')
    }
}
//类下面的属性
Animal.sex = 'male'
let cat = new Animal(1)
//实例不能继承来读取类的属性
console.log(cat.age,cat.sex)
cat.say()
//实例不能读取它的类的静态方法
// cat.walk()
Animal.walk()

//类的继承
class Cat extends Animal{
    constructor(age,kind){
        super(age)
        this.kind = kind
    }
    say(){
        console.log('miu~~~miu~~')
    }
}
let cat2 = new Cat(2,'外星人')
console.log(cat2.age)
cat2.sleep()
//子类也能使用父类的静态方法
Cat.walk()

let stu1 = Symbol('李四')
let stu2 = Symbol('李四')
let score = {
    张三:{math:99,chinese:80,history:100},
    [stu1]:{math:100,chinese:99,history:90},
    [stu2]:{math:100,chinese:100,history:100}
}
//只能获取字符串类型的属性
Object.keys(score).forEach(key=>{
    console.log(key)
})
Object.getOwnPropertyNames(score).forEach(key=>{
    console.log(key)
})
//只能获取Symbol类型的属性
Object.getOwnPropertySymbols(score).forEach(key=>{
    console.log(key)
})
//既能输出字符串类型的属性，也能输出Symbol类型的属性
Reflect.ownKeys(score).forEach(key=>{
    console.log(key)
})